// function createArray<T>(len: number, value: T) {
//     const arr = []
//     for (let i = 0; i < len; i++) {
//         arr.push(value)
//     }
//     return arr
// }
const createArray = <T>(len: number, value: T) => {
    const result = []
    for (let i = 0; i < len; i++) {
      result.push(value)
    }
    return result
  }

console.log(createArray<number>(3, 666));
console.log(createArray<string>(3, 'nihao'));
console.log(createArray<boolean>(3, true));





export { }
